package parser

import (
	"imooc/studygo/crawler/engine"
	"regexp"
	"fmt"
)

const cityListRe = `<a href="(http://www.zhenai.com/zhenghun/[0-9a-z]+)[^>]*>([^>]+)</a>`
func ParserCityList(contents []byte) engine.ParserResult {
	re := regexp.MustCompile(cityListRe)
	matchs := re.FindAllSubmatch(html, -1)
	for _, m := range matchs {
		fmt.Printf("City: %s, URL: %s\n", m[2], m[1])
	}
	fmt.Printf("matchs len = %d\n", len(matchs))
}